<?
	require ('../businessObjects/accountableTransaction.php');
?>
<script language="javascript" type="text/javascript">
$(document).ready(function(){	   
/*Apply default button style. */		
		$('.confirmButton').button();
		$('.gridButton').button();
  });
</script>
<form id="form1" action="?<?=$_SERVER['QUERY_STRING']?>" method="post">
<div class="workspace_panel">
<div class="workspace_panel_row">
	<div class="workspace_panel_cell">
		<div style="display:table; width:100%;">
			<div style="display:table-row">
				<div style="display:table-cell; width:20%;">
				  <h1>Delete reimbursement</h1></div>
				<div style="display:table-cell; text-align:right;">
					<a href="<?=$go_back_search?>" class="gridButton">Go Back </a>
				</div>
			</div>
		</div>			
	</div>	
</div>
<?php	
	if ($_GET['ref'] != '') {	
		if ($_GET['confirmed']=='yes'){
		$sysObj = new sysFunctions();
		$id = $sysObj->decryptData($_GET['ref']);
		$searchObject = new reimbursement();
		$searchObject->deleteReimbursement($id,$_SESSION['username']);
?>
<div class="workspace_panel_row">	
	<div class="workspace_panel_cell">
	<?=$searchObject->message();?>
	</div>
</div>
<?		
		}else{		
		$sysObj = new sysFunctions();
		$id = $sysObj->decryptData($_GET['ref']);
		$searchObject = new reimbursement();
		$searchObject->searchReimbursement('',$id,'','','','','','','');
		$row = mysqli_fetch_array($searchObject->resultSet());
	
?>
<div class="workspace_panel_row">	
	<div class="workspace_panel_cell">
		<div class="frmContainer" style="width:50%">
				<div class="frmRow">
					<div class="frmLabelCell">Transaction ID</div>
					<div class="frmContentCell"><?=$row['trnId']?></div>
				</div>
				<div class="frmRow">
					<div class="frmLabelCell">Enterprise</div>
					<div class="frmContentCell"><?=$row['enterpriseName']?></div>
				</div>
                <div class="frmRow">
					<div class="frmLabelCell">Costed by</div>
					<div class="frmContentCell"><?=$row['employeeName']?></div>
				</div>
				<div class="frmRow">
					<div class="frmLabelCell">Date</div>
					<div class="frmContentCell"><?=date("Y-m-d",strtotime($row['trnDate']));?></div>
				</div>
				<div class="frmRow">
					<div class="frmLabelCell">Amount GTQ</div>
					<div class="frmContentCell"><?=$row['amount_GTQ']?></div>
				</div>
				<div class="frmRow">
					<div class="frmLabelCell">Amount USD</div>
					<div class="frmContentCell"><?=$row['amount_USD']?></div>
				</div>
				<div class="frmRow">
					<div class="frmLabelCell">Exchange Rate USD / GTQ</div>
					<div class="frmContentCell"><?=$row['exchangeRate']?></div>
				</div>
				<div class="frmRow">
					<div class="frmLabelCell">Category</div>
					<div class="frmContentCell"><?=$row['CategoryName']?></div>
				</div>
				<div class="frmRow">
					<div class="frmLabelCell">Tracking Notes</div>
					<div class="frmContentCell"><?=$row['trackingNotes']?></div>
				</div>
		</div>
	</div>
</div>
<div class="workspace_panel_row">
	<div class="workspace_panel_cell">
	<p>Please confirm if you want to proceed to 
		<a href="?<?=$_SERVER['QUERY_STRING']?>&confirmed=yes" class="confirmButton">Delete</a>
	</p>
	</div>
</div>
<?}} ?>
</div>
</form>